<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
 * Created by JetBrains PhpStorm.
 * User: xx
 * Date: 14-7-2
 * Time: 下午9:28
 * To change this template use File | Settings | File Templates.
 */

/**
 * 权限类
 * Class Permission
 */
class Permission
{
    var $CI;
    var $local_time;

//    var $codeMod;

    public function __construct($config = array())
    {
        echo "hello<p/>";
        $this->CI =& get_instance();
        $this->local_time = time();
        if (count($config) > 0) {
            $this->initialize($config);
        }

//        $this->CI->load->model('code_model', 'codeMod');
//        $this->codeMod = & $this->CI->codeMod;
    }

    /**
     * 鉴权
     * @param $c
     * @param $m
     * @return bool
     */
    public function permission($c, $m)
    {
        $key = $c . '->' . $m;

        if (isset($this->blacklist[$key])) {
            return false;
        }
        if (isset($this->whitelist[$key])) {
            return true;
        }
        return false;
    }


}